package com.geuso.xingdutch;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.geuso.xingdutch.util.SoundUtil;

public class MainActivity extends Activity {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.main);

		getFragmentManager().beginTransaction().add(R.id.container, new MainMenuFragment()).commit();
		
	}
	
	
	public void playKiss(View v){
		SoundUtil.playSound(this, R.raw.flair_tom_kiss_kiss_kiss);
	}
		

	public static class MainMenuFragment extends Fragment {

		public MainMenuFragment() {
		}

		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
			View rootView = inflater.inflate(R.layout.main_fragment, container, false);
	
			return rootView;
		}
		
		@Override
		public void onActivityCreated(Bundle savedInstanceState){
			super.onActivityCreated(savedInstanceState);
			ListView l = (ListView) getView().findViewById(R.id.menu_list);
			if (l != null){
				l.setAdapter(new MainMenuListAdapter(getActivity(),  MainMenuListData.menu_items));
			}
		}
	}

}
